package com.sg.controller.pbff;

import com.sg.service.biz.pbff.SecurityService;
import com.sg.dto.biz.pbff.req.*;
import com.sg.dto.biz.pbff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Security", tags = {"Security"})
@RestController
// @RequestMapping("/poms/security/")
public class SecurityController {

    @Autowired
    SecurityService securityService;

    /**
     * B1存档软件授权证书(管理)
     * gen by moon at 5/12/2023, 3:06:39 AM
     */
    @PostMapping("/oms/platform/mgt/security/archiveSoftwareAuthorization")
    @ApiOperation(value = "B1存档软件授权证书(管理)", response = OkrResult.class)
    public OkrResult<BffArchiveSoftwareAuthorizationRespDto> archiveSoftwareAuthorization(@RequestBody(required = false) @Validated BffArchiveSoftwareAuthorizationReqDto reqDTO) {
        return OkrResult.success(securityService.archiveSoftwareAuthorization(reqDTO));
    }

    /**
     * B1查询软件授权证书列表(管理)
     * gen by moon at 5/12/2023, 3:15:55 AM
     */
    @PostMapping("/oms/platform/mgt/security/querySoftwareAuthorizationList")
    @ApiOperation(value = "B1查询软件授权证书列表(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySoftwareAuthorizationListRespDto> querySoftwareAuthorizationList(@RequestBody(required = false) @Validated BffQuerySoftwareAuthorizationListReqDto reqDTO) {
        return OkrResult.success(securityService.querySoftwareAuthorizationList(reqDTO));
    }

    /**
     * B1查询软件授权证书详情(管理)
     * gen by moon at 5/12/2023, 3:15:57 AM
     */
    @PostMapping("/oms/platform/mgt/security/querySoftwareAuthorizationDetail")
    @ApiOperation(value = "B1查询软件授权证书详情(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySoftwareAuthorizationDetailRespDto> querySoftwareAuthorizationDetail(@RequestBody(required = false) @Validated BffQuerySoftwareAuthorizationDetailReqDto reqDTO) {
        return OkrResult.success(securityService.querySoftwareAuthorizationDetail(reqDTO));
    }

    /**
     * B1修改软件授权证书(管理)
     * gen by moon at 5/12/2023, 3:15:59 AM
     */
    @PostMapping("/oms/platform/mgt/security/updateSoftwareAuthorization")
    @ApiOperation(value = "B1修改软件授权证书(管理)", response = OkrResult.class)
    public OkrResult<BffUpdateSoftwareAuthorizationRespDto> updateSoftwareAuthorization(@RequestBody(required = false) @Validated BffUpdateSoftwareAuthorizationReqDto reqDTO) {
        return OkrResult.success(securityService.updateSoftwareAuthorization(reqDTO));
    }

    /**
     * B1删除软件授权证书(管理)
     * gen by moon at 5/12/2023, 3:16:02 AM
     */
    @PostMapping("/oms/platform/mgt/security/deleteSoftwareAuthorization")
    @ApiOperation(value = "B1删除软件授权证书(管理)", response = OkrResult.class)
    public OkrResult<BffDeleteSoftwareAuthorizationRespDto> deleteSoftwareAuthorization(@RequestBody(required = false) @Validated BffDeleteSoftwareAuthorizationReqDto reqDTO) {
        return OkrResult.success(securityService.deleteSoftwareAuthorization(reqDTO));
    }

    /**
     * B1查询安全License详情(管理)
     * gen by moon at 5/14/2023, 10:25:58 PM
     */
    @PostMapping("/oms/platform/mgt/security/querySecurityLicenseDetail")
    @ApiOperation(value = "B1查询安全License详情(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySecurityLicenseDetailRespDto> querySecurityLicenseDetail(@RequestBody(required = false) @Validated BffQuerySecurityLicenseDetailReqDto reqDTO) {
        return OkrResult.success(securityService.querySecurityLicenseDetail(reqDTO));
    }
}
